use AdventureWorks2012
go
if object_ID ('CreatingTable1') is not null
drop table CreatingTable1;

create table CreatingTable1 
(
	TBID uniqueidentifier ROWGUIDCOL primary key default newsequentialID(),
	
)
if object_ID ('CreatingTable2') is not null
drop table CreatingTable2;
create table CreatingTable2
(
	TBID uniqueidentifier ROWGUIDCOL primary key default newID(),
	
)
with
(Data_Compression = ROW);

set nocount on;

declare @counter int =0;
while @counter<10
begin
begin transaction
insert CreatingTable1 default values;
if (@@ERROR=null) 
insert CreatingTable2 default values;
else 
rollback

set @counter=@counter+1;
print @counter;
end
select * from CreatingTable1
select * from CreatingTable2
Select @@TRANCOUNT